package cn.edu.xmut.chen.zhlg.zhlg.user.param;

import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;

@Getter
@Setter
public class UserRegisterParam {
    /**
     * 手机号
     */
    @ApiModelProperty(value = "手机号", required = true, position = 1)
    @NotBlank(message = "手机号不能为空")
    @Length(min = 11, max = 11, message = "手机号只能为11位")
    private String phone;

    /**
     * 验证码
     */
    @ApiModelProperty(value = "验证码", required = true, position = 2)
    @NotBlank(message = "验证码不能为空")
    @Length(min = 4, max = 4, message = "验证码只能为11位")
    private String code;

    /**
     * 角色
     */
    @ApiModelProperty(value = "角色", required = true, position = 3)
    @NotBlank(message = "角色不能为空")
    @Pattern(regexp = "^(user|company)$", message = "角色只能为user或company")
    private String role;
}
